fix(ci): inject KOKORO_ROOT fallback for Ubuntu 22.04 - #18004
Conversation
There was a problem hiding this comment.
Code Review
This pull request exports the KOKORO_ROOT environment variable in the trampoline script and adds a trigger comment to a production Python file in the google-cloud-vision package. The review feedback recommends avoiding dummy trigger comments in production source files, suggesting instead the use of empty commits or modifying test files to trigger CI/CD pipelines.
| import proto # type: ignore | ||
| from google.api_core import protobuf_helpers as protobuf | ||
|
|
||
| # Trigger comment for system tests |
There was a problem hiding this comment.
Avoid adding dummy or trigger comments to production source files to trigger CI/CD pipelines or system tests. This can lead to stale comments and unnecessary noise in the codebase history. Instead, consider using an empty commit (git commit --allow-empty -m 'trigger tests') or modifying a test file if absolutely necessary.
Description
Problem
Kokoro jobs running on the newer Ubuntu 22.04 environment fail because the
KOKORO_ROOTenvironment variable is missing. This causes the Python scripttrampoline_v1.pyto crash with aKeyError.Solution
This change modifies
.kokoro/trampoline.shto set a default value forKOKORO_ROOT(/tmpfs) if it is not already set. This ensures compatibility with the new environment without breaking existing workflows.A temporary comment was also added to
packages/google-cloud-vision/google/cloud/vision_helpers/__init__.pyto ensure that system tests are triggered for this change.Notes to Reviewers
This is a repository-level workaround to verify if the missing environment variable is the main cause of the Kokoro build failures on Ubuntu 22.04. If this fixes the tests, we can discuss whether to keep this fallback in the script or address it in the environment setup.